package com.crazy.sso.website.controller;

import com.baomidou.kisso.SSOConfig;
import com.baomidou.kisso.SSOHelper;
import com.baomidou.kisso.SSOToken;
import com.crazy.shell.common.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 首页
 * Created by creazier.huang on 16/4/17.
 */
@Controller
@RequestMapping("index")
public class IndexController extends BaseController{

    @RequestMapping("/index.htm")
    public String index(Model model){
        SSOToken st = SSOHelper.attrToken(request);
        if (st != null) {
            System.err.println(" Long 类型 ID: " + st.getId());
            model.addAttribute("userId", st.getUid());
        }
        System.err.println(" 启动注入测试模式：" + SSOConfig.getInstance().getRunMode());
        return "index/index";
    }

}
